package com.yanqu.road.server.manger.activity.tonbing;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.tonbing.config.TonBingConfig;
import com.yanqu.road.pb.activity.TonBingProto;
import com.yanqu.road.pb.commonactivity.CommonActivityProto;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.ServerListMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.RandomHelper;

public class TonBingBugMgr extends TempMgr {

    private static RandomHelper randomHelper = new RandomHelper();

    public static void chatTest(GamePlayer player,String content){
        if(ServerListMgr.getChannelId(GameServer.getInstance().getServerId()) != 666){
            return;
        }
        if(content.equals("26450")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                CommonActivityProto.CommonActivityRankListReqMsg.Builder reqMsg = CommonActivityProto.CommonActivityRankListReqMsg.newBuilder();
                reqMsg.setActivityId(activityInfo.getActivityId());
                player.sendPacket(Protocol.S_PEAK_UNION_MAX_ABILITY_RANK_LIST, reqMsg);
            }
        }
        if(content.equals("26792")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingGetBattleInfoReqMsg.Builder reqMsg = TonBingProto.TonBingGetBattleInfoReqMsg.newBuilder();
                player.sendPacket(Protocol.S_TON_BING_BATTLE_INFO, reqMsg);
            }
        }
        if(content.equals("26711")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingGetDataReqMsg.Builder reqMsg = TonBingProto.TonBingGetDataReqMsg.newBuilder();
                reqMsg.setMatchId(1);
                player.sendPacket(Protocol.S_TON_BING_GET_DATA, reqMsg);
            }
        }
        if(content.equals("26713")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.CrossTonBingReqMsg.Builder reqMsg = TonBingProto.CrossTonBingReqMsg.newBuilder();
                reqMsg.setActivityId(activityInfo.getActivityId());
                player.sendPacket(Protocol.S_TON_BING_UPDATE_PATRONS_ABILITY, reqMsg);
            }
        }
        if(content.equals("26714")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingMoveTeamReqMsg.Builder reqMsg = TonBingProto.TonBingMoveTeamReqMsg.newBuilder();
                reqMsg.addOccupation(1);
                reqMsg.setToCityId(10022);
                reqMsg.setIsTargetCity(false);
                player.sendPacket(Protocol.S_TON_BING_MOVE_TEAM, reqMsg);
            }
        }
        if(content.equals("26715")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingChangeTeamSoldierReqMsg.Builder reqMsg = TonBingProto.TonBingChangeTeamSoldierReqMsg.newBuilder();
                TonBingProto.TonBingChangeTeamSoldierMsg.Builder aMsg = TonBingProto.TonBingChangeTeamSoldierMsg.newBuilder();
                aMsg.setOccupation(1);
                aMsg.setSoldierNum(100);
                player.sendPacket(Protocol.S_TON_BING_CHANGE_TEAM_SOLDIER, reqMsg);
            }
        }
        if(content.equals("26716")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingRecruitSoldierReqMsg.Builder reqMsg = TonBingProto.TonBingRecruitSoldierReqMsg.newBuilder();
                reqMsg.setType(1);
                reqMsg.setNum(100);
                reqMsg.setSpeed(2);
                player.sendPacket(Protocol.S_TON_BING_RECRUIT_SOLDIER, reqMsg);
            }
        }
        if(content.equals("26747")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingGetUserRankReqMsg.Builder reqMsg = TonBingProto.TonBingGetUserRankReqMsg.newBuilder();
                reqMsg.setType(1);
                player.sendPacket(Protocol.S_TON_BING_GET_USER_RANK_LIST, reqMsg);
            }
        }
        if(content.equals("26741")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingGetCampUnionRankReqMsg.Builder reqMsg = TonBingProto.TonBingGetCampUnionRankReqMsg.newBuilder();
                reqMsg.setCampId(1);
                reqMsg.setMatchId(1);
                player.sendPacket(Protocol.S_TON_BING_GET_CAMP_UNION_RANK_LIST, reqMsg);
            }
        }
        if(content.equals("26740")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.CrossTonBingReqMsg.Builder reqMsg = TonBingProto.CrossTonBingReqMsg.newBuilder();
                reqMsg.setActivityId(activityInfo.getActivityId());
                player.sendPacket(Protocol.S_TON_BING_GET_CAMP_RANK_LIST, reqMsg);
            }
        }
        if(content.equals("26793")){
            ActivityInfo activityInfo = TonBingMgr.getActivityInfo();
            if(activityInfo != null){
                TonBingProto.TonBingGetTodayRankReqMsg.Builder reqMsg = TonBingProto.TonBingGetTodayRankReqMsg.newBuilder();
                player.sendPacket(Protocol.S_TON_BING_TODAY_RANK, reqMsg);
            }
        }
    }

    /**
     * 重新加载活动
     */
    public static void reloadActivityData() {

    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return true;
    }

    @Override
    public boolean reloadData() throws Exception {
        return true;
    }

    @Override
    public boolean stop() {
        return true;
    }
}
